Finding the Source of Type Errors Interactively ( Draft )
نویسنده
چکیده
1 Introduction All modern functional languages use variants of the Hindley/Milner type system. This system is quite exible since it allows values to have more than one type, and it is convenient because types can be derived automatically, making explicit type declarations unnecessary. Most trivial programming errors cause the type-deriver to emit error messages, which are usually easy to understand. However, the code where an inconsistency is detected is sometimes not the code that caused the error. When the type-deriver reports an inconsistency at the wrong place, most programmers use cumbersome trial-and-error to nd their mistake: either they give types to expressions manually and recompile until the type-deriver disagrees, or else they remove large parts of the program and recompile until the error disappears. Can we improve this situation? We could try to make the type-deriver better at pinpointing the real error, but we should not expect full success, since the location of a type error is subjective and depends on the programmer's intentions. This paper gives the outline of a type-deriver that can explain its reasoning in response to questions. First, we should be able to point at a subexpression and ask what type it has; such an interface has been implemented by Jan Sparud at Chalmers [6]. Second, we should be able to ask why a certain type has been derived; such a type-deriver has been implemented by Mitchell Wand [7]. When an error is detected, Wand's type-deriver suggests a number of possible error sites. One of these should be the subjective error, but sometimes too many possibilities are given. Therefore, I will propose an interactive way to access the information provided by Wand's type-deriver. Warning: The paper describes work that has hardly begun. I have not implemented anything, and realistic hand-simulations are dicult. But I do think an interactive interface is important: the type-deriver knows the type of every subexpression and how they were derived, but since it does not know the programmer's intentions and mistaken beliefs, it cannot decide by itself how much to tell. And if it tells all it knows at once, the programmer will be swamped.
منابع مشابه
بهینه سازی تک معیاره و چند معیاره برج خنک کن خشک هلر در نیروگاههای سیکل ترکیبی با استفاده از الگوریتم ژنتیک
In this paper the effect of site conditions, which are Altitude, Temperature and Relative Humidity and also Heat Dissipation Capacity are investigated on the optimized design of natural draft dry cooling towers with specific kind of heat exchangers, known as Forgo T60 type. A genetic algorithm program has been developed for optimized design of these cooling towers. Objective function includes b...
متن کاملNumerical Study of a Pipe Extension Effect in Draft Tube on Hydraulic Turbine Performance
Draft tube of Francis type hydraulic turbine usually consists of: cone, elbow and diffuser. On the contrary, in some power stations an extra pipe should be added to the draft tube at the bottom of cone because of installation limitation. In this paper, this special case has been numerically studied. To this end CFD analysis was applied to simulate all parts of hydraulic turbine. A homogeneous m...
متن کاملپایش مسیر جریان اطلاعات و خطاهای موجود در سیستم اطلاعات بیمارستانی (HIS) مرکز آموزش درمانی امام خمینی (ره)
Background & Aims : Errors in the Health and Medical Systems has multi-dimensional parameters . Human parameters, system, equipment are the error making factors and by managing these parameters such errors can be reduced. The aim of this study was to survey the path of information and errors within the HIS system. Materials & Methods : T his study was based on analytic al method in which ...
متن کاملبهبود و توسعه یک سیستم مترجمیار انگلیسی به فارسی
In recent years, significant improvements have been achieved in statistical machine translation (SMT), but still even the best machine translation technology is far from replacing or even competing with human translators. Another way to increase the productivity of the translation process is computer-assisted translation (CAT) system. In a CAT system, the human translator begins to type the tra...
متن کاملThe impact of wind-generated bubble layer on matched field sound source localization in shallow water (Research Article)
This paper investigates the effect of the wind-generated bubble layer on the underwater sound source localization in the Persian Gulf shallow-water environment through computer simulation and the matched field processing technique. An underwater sound source of 2-10 kHz located at depths of 10, 45, and 75 m was considered at a distance of 4 km from a linear vertical receiver array. The estimati...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1993